package cn.steam.ctrl;

import cn.steam.aop.NeedSign;
import cn.steam.service.TokenService;
import cn.steam.xo.John;
import cn.steam.xo.TokenVO;
import cn.steam.xo.VideoRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhang jintao on 2022/05/27
 **/
@RestController
@RequestMapping("john")
@Slf4j
public class JohnCtrl {

    @Autowired
    TokenService tokenService;

    @GetMapping("/")
    @NeedSign
    public John get(John john) {
        System.out.println(john);
        return john;
    }

    @GetMapping("/token")
    public void token() {
        TokenVO tokenVO = tokenService.get();
        System.out.println(tokenVO);
    }

    @PostMapping("bool")
    public String bool(@RequestBody VideoRequest request) {
        log.info("收到请求：{}", request.isVideo());
        return "bool";
    }


}
